home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
mflms101.arc
/
MFLSTRNG.H
< prev
next >
Wrap
C/C++ Source or Header
|
1989-11-25
|
4KB
|
99 lines
/************************************************************************/
/* */
/* MFLSTRNG Header file */
/* */
/* MicroFirm Function Library string functions. */
/* */
/* Copyright 1988-89 by Robert B. Stout dba MicroFirm */
/* All rights reserved */
/* */
/* Copyright 1986, 1987 by S.E. Margison */
/* */
/* Compiled by QC 2.0 for use with MSC 5.1 or QC 2.0 or later. */
/* */
/************************************************************************/
#ifndef MFLSTRNG_H
#define MFLSTRNG_H
#include <mfldefs.h>
#define LAST_CHAR(string) (((char *)string)[strlen(string)-1])
#define NEXT_TO_LAST_CHAR(string) (((char *)string)[strlen(string)-2])
#define STRING_TERMINATOR(string) (((char *)string)[strlen(string)])
#define STREQ(str1,str2) (!strcmp(str1,str2))
#define STREQI(str1,str2) (!strcmpl(str1,str2))
/* The following may cause problems when porting code */
/* If so, simply #undefine index and rindex */
#define index(s,c) ((strchr(s,c)) ? (int)(strchr(s,c)-s) : -1)
#define rindex(s,c) ((strrchr(s,c)) ? (int)(strrchr(s,c)-s) : -1)
#ifndef _Cdecl_
#ifdef NO_EXT_KEYS
#define _Cdecl_
#else
#define _Cdecl_ cdecl
#endif
#endif
/************************************************************************/
/* */
/* BASIC-like string functions */
/* */
/************************************************************************/
extern int STR_pool_size;
extern LOGICAL STRALLOC_OK;
char * _Cdecl_ stralloc(int);
char * _Cdecl_ left(char *, int);
char * _Cdecl_ right(char *, int);
char * _Cdecl_ mid(char *, int, int);
char * _Cdecl_ string_add(char *, ...);
int _Cdecl_ str_init(int, int);
void _Cdecl_ str_free(void);
/************************************************************************/
/* */
/* String translation functions */
/* */
/************************************************************************/
int _Cdecl_ strxlat(char *, char *, char *);
int _Cdecl_ strixlat(char *, char *, char *);
int _Cdecl_ strnxlat(char *, char *, char *, int);
int _Cdecl_ strnixlat(char *, char *, char *, int);
/************************************************************************/
/* */
/* Functions to remove whitespace */
/* */
/************************************************************************/
void _Cdecl_ strip(char *),
_Cdecl_ lv1ws(char *);
char * _Cdecl_ rmlead(char *),
* _Cdecl_ rmtrail(char *),
* _Cdecl_ rmallws(char *);
/************************************************************************/
/* */
/* Miscellaneous functions */
/* */
/************************************************************************/
void _Cdecl_ fillch(char *, char, int),
_Cdecl_ loadstr(char *, char *, int);
int _Cdecl_ argval(char *, int *, int),
_Cdecl_ center(char *, int),
_Cdecl_ dstr_i(char *, int*),
_Cdecl_ i_dstr(char *, int);
unsigned int _Cdecl_ hstr_i(char *);
#endif /* MFLSTRNG_H */